<template>
	<view>
		<view class="main">
			<view class="tit"><text>*</text>视频话题</view>
			<textarea placeholder="建议3-10个词" v-model="value"></textarea>
			<view class="tips">
				<view>注意: 内容不能包含微信、手机号、网址等敏感信息</view>
			</view>
			<!-- <view class="tit"><text>*</text>前缀(可填品牌或地区)</view>
			<textarea placeholder="每行一个词，最多5个前缀"></textarea>
			<view class="tips">
				<view>每行一个词，建议3-5个词，每个词10个字之内可设置地区或者品牌，</view>
				<view>例如：广州，南京，某某品牌</view>
			</view>
			<view class="tit"><text>*</text>后缀词</view>
			<textarea placeholder="每行一个词，最多5个后缀"></textarea>
			<view class="tips">
				<view>每行一个词，建议3-5个词，每个词10个字之内</view>
				<view>例如：哪里好，价格，公司，门店，多少钱</view>
			</view> -->
			<view class="subBtn" @click="toSubmit()">确定</view>
		</view>
	</view>
</template>

<script>
	import {
		storeKeywordIndex
	} from '@/api/apiData.js';
	export default {
		data() {
			return {
				value: '',
				range: [{
					"value": 0,
					"text": "手机竖屏版"
				}, {
					"value": 1,
					"text": "电脑横屏版"
				}],
				check: 0,
				show: false,
				columns: [
					['评论回复', '私信回复']
				],
				type: ''
			};
		},
		methods: {
			change(e) {
				console.log(e)
			},
			onConfirm(e) {
				console.log(e)
				this.type = e.value[0]
				this.show = false
			},
			async toSubmit() {
				let obj = {
					'row[main_keyword]': this.value,
					'row[pre_keyword]]': '',
					'row[next_keyword]': '',
				}
				const result = await storeKeywordIndex(obj)
				if (result.code == 1) {
					uni.showToast({
						title: '添加成功'
					})
				} else {
					uni.showToast({
						title: result.msg,
						icon: 'error'
					})
				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		margin-top: 15rpx;
		background: white;
		padding: 7rpx 30rpx;

		.title {
			font-size: 32rpx;
			font-weight: bold;
		}

		.tit {
			font-size: 28rpx;
			margin: 17rpx 0;

			text {
				color: #FF0000;
			}
		}

		input {
			padding: 14rpx 15rpx;
			font-size: 20rpx;
			border: solid 1rpx #707070;
			border-radius: 10rpx;
		}

		textarea {
			border: solid 1rpx #707070;
			padding: 15rpx 9rpx;
			border-radius: 10rpx;
			font-size: 20rpx;
		}

		.btns {
			margin: 20rpx 40rpx;

			view {
				width: 250rpx;
				height: 60rpx;
				line-height: 60rpx;
				border-radius: 10rpx;
				justify-content: center;
				color: white;
				text-align: center;
			}

			.btn-item1 {
				background: #DD4E3D;
			}

			.btn-item2 {
				background: #5D9CEB;
			}

			text {
				margin-left: 10rpx;
			}
		}

		.btns2 {
			margin: 20rpx 0;

			view {
				width: 200rpx;
			}
		}

		.tips {
			font-size: 20rpx;
			margin: 15rpx 0;
		}

		.subBtn {
			font-size: 30rpx;
			color: white;
			padding: 8rpx 95rpx;
			background: #5D9CEB;
			width: fit-content;
			margin: 137rpx auto;
			border-radius: 10rpx;
		}
	}
</style>